#!/bin/bash


ROOT_DIR=$(pwd)
echo "ROOT_DIR:  $ROOT_DIR"

# 获取 git 分支
branch=$(git rev-parse --abbrev-ref HEAD)
# 获取 commitId
commitId=$(git rev-parse --short HEAD)
# 获取编译日期
buildDate1=$(date '+%Y%m%d_%H%M%S')

rm -rf dist/ dcs/target/  dcs/dist
mkdir -p dist/vdam_linux/{configs,sbin}


# 三、编译 dcs
echo "3.build............................................java"
cd ${ROOT_DIR}
mvn clean package -DskipTests

cp dps/target/dps*.jar  $ROOT_DIR/dist/vdam_linux/dps.jar


cp dcs/target/dcs*.jar  $ROOT_DIR/dist/vdam_linux/dcs.jar

cd $ROOT_DIR/dist
#tar -czvf vdam_linux.${branch}.${commitId}.${buildDate1}.tar.gz vdam_linux_arm64


